<?php
    require('./Utils.php');

    $type = $_GET['type'];

    $sql = "SELECT p.id,name, price, p.image, stock
    FROM  pet p LEFT JOIN pet_type t
    ON p.type_id = t.id
    WHERE type = ? LIMIT 5";

    $conn = getConnection();
    $data = query_list($conn,$sql, $type);

    getJson(200, '获取成功', $data);
?>